﻿namespace Lite.Messaging
{
    /// <summary>
    /// A factory for creating references to message queues.
    /// </summary>
    public interface IMessageQueueFactory
    {
        /// <summary>
        /// Creates a new message queue for the underlying provider with the
        /// specified name.
        /// </summary>
        /// <param name="queueName">
        /// The unique identifier to use for this queue.
        /// </param>
        /// <returns>
        /// A message queue wrapper instance containing the new queue.
        /// </returns>
        IMessageQueue CreateMessageQueue(string queueName);

        /// <summary>
        /// Creates a new queue monitor on the specified queue.
        /// </summary>
        /// <param name="queueName">
        /// The name of the queue to monitor.
        /// </param>
        /// <returns>
        /// A new <see cref="Lite.Messaging.IQueueMonitor"/> instance.
        /// </returns>
        IQueueMonitor CreateQueueMonitor(string queueName);

        /// <summary>
        /// Verifies whether a queue with the specified name exists in the
        /// underlying provider.
        /// </summary>
        /// <param name="queueName">
        /// The unique identifier for the queue.
        /// </param>
        /// <returns>
        /// True if the queue exists and can be accessed; otherwise false.
        /// </returns>
        bool Exists(string queueName);

        /// <summary>
        /// Returns a wrapper instance of the specified queue.
        /// </summary>
        /// <param name="queueName">
        /// The unique identifier for the queue.
        /// </param>
        /// <returns>
        /// A message queue wrapper instance.
        /// </returns>
        /// <exception cref="Lite.Messaging.QueueNotFoundException" />
        IMessageQueue GetMessageQueue(string queueName);
    }
}